package com.springboot.cloud.demos.feign.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.UserForm;
import com.springboot.cloud.demos.entity.form.UserQueryForm;
import com.springboot.cloud.demos.entity.form.UserRequestEntity;
import com.springboot.cloud.demos.entity.param.FollowQueryParam;
import com.springboot.cloud.demos.entity.po.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "ribbon-consumer", fallback = UserServiceFallback.class)
public interface UserService {

    @RequestMapping(value = "/user", method = RequestMethod.POST)
    Result<User> save(@RequestBody UserForm userForm);

    @RequestMapping(value = "/user/queryByMobile", method = RequestMethod.GET)
    Result<User> queryByMobile(@RequestParam("mobile") String mobile);

    @RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
    Result<User> getById(@PathVariable("id") String id);

    @RequestMapping(value = "/user", method = RequestMethod.PUT)
    Result update(@RequestBody User existUser);

    @RequestMapping(value = "/user/getMyFollow", method = RequestMethod.GET)
    Result<Page> getMyFollow(@RequestBody UserQueryForm queryParam);

    @RequestMapping(value = "/user/getFollowMe", method = RequestMethod.GET)
    Result<Page> getFollowMe(@RequestBody UserQueryForm queryParam);

    @RequestMapping(value = "/user/nearBy", method = RequestMethod.GET)
    Result nearBy(@RequestBody UserQueryForm queryParam);

    @RequestMapping(value = "/user/recommend", method = RequestMethod.GET)
    Result recommend(@RequestBody UserQueryForm queryParam);

    @RequestMapping(value = "/user/getStatistics", method = RequestMethod.GET)
    Result getStatistics(@RequestParam("userId") String userId);

}
